package bio;

import java.io.IOException;
import java.net.ServerSocket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class BioServerPool {
    public static void main(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(2);
        try (ServerSocket server = new ServerSocket(8888)) {
            while (true) {
                pool.submit(new ClientHandler(server.accept(), new RequestHandler()));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
